﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace Framework.Platform.Components.UI.View
{
    public partial class BaseNavigator : BaseView, INavigator
    {
        public BaseNavigator()
        {
            InitializeComponent();
        }

        #region INavigator Members
        private NavigatorItemBase _SelectedItem;

        public NavigatorItemBase SelectedItem
        {
            get
            {
                return _SelectedItem;
            }
            set
            {
                _SelectedItem = value;
            }
        }

        public virtual void SelectItemByKey(string key)
        {
            if (LicenseManager.CurrentContext.UsageMode == LicenseUsageMode.Runtime)
            {
                throw new NotImplementedException(string.Format("{0} must override the SelectItemByKey method.", this.GetType().FullName));
            }
        }

        public virtual void AddItem(NavigatorItemBase item)
        {
            if (LicenseManager.CurrentContext.UsageMode == LicenseUsageMode.Runtime)
            {
                throw new NotImplementedException(string.Format("{0} must override the AddItem method.", this.GetType().FullName));
            }
        }

        public virtual void RemoveItem(string itemKey)
        {
            if (LicenseManager.CurrentContext.UsageMode == LicenseUsageMode.Runtime)
            {
                throw new NotImplementedException(string.Format("{0} must override the RemoveItem method.", this.GetType().FullName));
            }
        }

        public virtual NavigatorItemBase GetItemByKey(string key)
        {
            if (LicenseManager.CurrentContext.UsageMode == LicenseUsageMode.Runtime)
            {
                throw new NotImplementedException(string.Format("{0} must override the GetItemByKey method.", this.GetType().FullName));
            }
            else
            {
                return null;
            }
        }
        #endregion
    }
}
